package cn.hsa.fqz.monitor.service;

import cn.hsa.fqz.common.utils.page.BasePage;
import cn.hsa.fqz.common.utils.page.PageData;
import cn.hsa.fqz.monitor.controller.vo.*;
import cn.hsa.fqz.monitor.entity.TMonitorDimension;
import cn.hsa.fqz.monitor.entity.TMonitorEntityExecuteSql;
import cn.hsa.fqz.monitor.service.dto.MonitorExecuteSqlDTO;
import cn.hsa.fqz.monitor.service.dto.TMonitorUserSqlConditionDTO;
import cn.hsa.fqz.task.service.dto.LoginUserDTO;
import cn.hsa.fqz.task.service.dto.TTagSubjectDTO;

import java.text.ParseException;
import java.util.List;
import java.util.Map;

public interface MonitorService {

    List<MonitorTagMinVO> getTagsByEnityCode(String entityCode, List<String> dimensions,String tableName);

    List<Map<String,Object>> getResultWihSqlByCondition(String host,Integer port, String passwd, TagMonitorQueryVO vo) throws ParseException;

    PageData<Map<String, Object>> getPageResultWihSqlByCondition(String ckHost,Integer port, String password, TagMonitorQueryVO vo) throws ParseException;

    PageData<Map<String, Object>> getMapPageResultWihSqlByCondition(String ckHost, Integer ckPort, String ckPasswd, TagMonitorQueryVO vo) throws ParseException;

    PageData<Map<String, Object>> getModelResultWihSqlByCondition(String ckHost, Integer ckPort, String ckPasswd, TagMonitorQueryVO vo) throws ParseException;

    List<Map<String,Object>> getSingleModelResultWihSqlByCondition(String ckHost, Integer ckPort, String ckPasswd, TagMonitorQueryVO vo) throws ParseException;

    List<Map<String, Object>> getStatisticResultWihSqlByCondition(String host,Integer port,String passwd, TagMonitorQueryVO vo) throws ParseException;

    Boolean addCurrentUserPreview(MonitorUserSubjectVO vo);

    List<String> getSubjectCodeByAccountAndEntityCode(String account,String entityCode);

    List<TMonitorEntityExecuteSql> getSqlExecuteBySourceEntityCode(String entityCode);

    List<TMonitorEntityExecuteSql> getSqlExecuteByTargetEntityCode(String entityCode);

    List<TMonitorDimension> getDimensionsByEntityCode(String entityCode);

    Object executeSql(LoginUserDTO loginUser, String ckHost, Integer ckPort, String ckPasswd, MonitorExecuteSqlDTO execute, BasePage page) throws ParseException;

    String getDefaultTag(TagMonitorQueryVO vo);

    Boolean addUserSqlCondition(MonitorUserSqlConditionVO vo, LoginUserDTO dto);

    TMonitorUserSqlConditionDTO getCurrentUserConditions(String userAcct, String entityCode);

    Boolean deleteCurrentUserConditions(Integer conditionId);

    List<MonitorTagMinVO> getDimensionPropertiesByEnityCode(TagQueryVO vo);

    List<TTagSubjectDTO> getTagSubject(String ckHost, Integer ckPort, String ckPasswd, TMonitorSubjectVO vo, String userAcct);
}
